package interfaces;


import interfaces.*;
import java.util.*;
import java.rmi.*;

/*
  Cette interface met en place les différentes fonctions qui seront utilisées 
  pour les opérations des clients.
*/

public interface ClientITF extends Remote {

	/*
	   Méthodes de set/get classiques.
	*/
	public void setNeighbourhood(Vector neighbourhood) throws RemoteException;
	public Vector getNeighbourhood() throws RemoteException;
	
	public String getHost() throws RemoteException;
	public int getPort() throws RemoteException;
	
	public void setID(int _id) throws RemoteException;
	public int  getID() throws RemoteException;
	
	public int getCapacity() throws RemoteException;
	
	public void setServer(ServeurITF _serveur) throws RemoteException;
	public ServeurITF getServer() throws RemoteException;
	public void addMail(MessageITF msg) throws RemoteException;
	public void removeMail(MessageITF msg) throws RemoteException;

	public boolean equals(ClientITF client) throws RemoteException;

	/*
	   Méthodes d'ajout/suppression d'un client à la liste de voisins.
	*/
	public void addNeighbour(ClientITF client) throws RemoteException;
	public void removeNeighbour(ClientITF client) throws RemoteException;

	/*
		Méthodes de connexion/déconnexion au serveur
	*/
	public ServeurITF connect_to(String server_host_port) throws Exception;
	public void disconnect() throws RemoteException;

	public int getNbMachines(ServeurITF serveur) throws RemoteException;

	/*
		Méthodes sur les messages, ils seront rentrés au clavier
		ou entrés en dur.
	*/
	public MessageITF writeMail() throws RemoteException;
	public void sendMail() throws RemoteException;
	// Masque sur sendMail dans le cas d'un envoi à tout le graphe
	public void forwardMail() throws RemoteException;
	public void checkBox() throws RemoteException;
	public boolean checkMails() throws RemoteException;
	public void answerMail(MessageITF msg) throws RemoteException;

	public String printNeighbours() throws RemoteException;
	public String printGraph() throws RemoteException;
	public int getNbNeighbours() throws RemoteException;
	
	/*
		Méthodes sur le jeton
	*/
	public void lancerElection() throws RemoteException;
	public void transfertJeton(TokenITF jeton, ClientITF from) throws RemoteException;
	public ClientITF next(TokenITF jeton, Vector<ClientITF> neighbours) throws RemoteException;
	public String[] choisiPar(ClientITF sender) throws RemoteException;
	
	/*
	   Méthodes relatives au streaming de la vidéo
	*/
	public void videoListen(ClientITF elu, String _ip, String _port) throws RemoteException;
	public void videoSend(String _ip, String _port) throws RemoteException;
	
}

